home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / dejagnu.lha / dejagnu-1.0.1 / tcl / tests / lsort.test < prev    next >
Text File  |  1992-11-06  |  2KB  |  42 lines

  1. # Commands covered:  lsort
  2. #
  3. # This file contains a collection of tests for one or more of the Tcl
  4. # built-in commands.  Sourcing this file into Tcl runs the tests and
  5. # generates output for errors.  No output means no errors were found.
  6. #
  7. # Copyright 1991 Regents of the University of California
  8. # Permission to use, copy, modify, and distribute this
  9. # software and its documentation for any purpose and without
  10. # fee is hereby granted, provided that this copyright notice
  11. # appears in all copies.  The University of California makes no
  12. # representations about the suitability of this software for any
  13. # purpose.  It is provided "as is" without express or implied
  14. # warranty.
  15. #
  16. # $Header: /sprite/src/lib/tcl/tests/RCS/lsort.test,v 1.1 91/08/21 13:37:25 ouster Exp $ (Berkeley)
  17.  
  18. if {[string compare test [info procs test]] == 1} then {source defs}
  19.  
  20. test lsort-1.1 {lsort command} {
  21.     lsort {abdeq ab 1 ac a}
  22. } {1 a ab abdeq ac}
  23. test lsort-1.2 {lsort command} {
  24.     lsort {{one long element}}
  25. } {{one long element}}
  26. test lsort-1.3 {lsort command} {
  27.     lsort {}
  28. } {}
  29. test lsort-1.4 {lsort with characters needing backslashes} {
  30.     lsort {$ \\ [] \{}
  31. } {{$} {[]} \\ \{}
  32.  
  33. test lsort-2.1 {lsort errors} {
  34.     list [catch lsort msg] $msg
  35. } {1 {wrong # args: should be "lsort list"}}
  36. test lsort-2.2 {lsort errors} {
  37.     list [catch {lsort a b} msg] $msg
  38. } {1 {wrong # args: should be "lsort list"}}
  39. test lsort-2.3 {lsort errors} {
  40.     list [catch {lsort "\{"} msg] $msg
  41. } {1 {unmatched open brace in list}}
  42.